package com.von.nhcf.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class NhcfWebMvcConfig implements WebMvcConfigurer {
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        //浏览器访问地址
        String urlPath =  "member/auth/to/register/page";
        // 目标视图名称，application.yml配置的前缀：prefix: classpath:/templates/，后缀：suffix: .html
        String viewName = "member_register";

        // 该方法相当于view-controller配置
        registry.addViewController(urlPath).setViewName(viewName);
        registry.addViewController("member/auth/to/login/page").setViewName("member_login");
        registry.addViewController("member/auth/to/home/page").setViewName("member_home");
        registry.addViewController("member/to/my/crowd/page").setViewName("member_crowd");
    }
}
